// mock/source/login.ts
function createUserList() {
  return [
    {
      userId: 1,
      photo:
        'https://cn.bing.com/images/search?q=%e5%a4%b4%e5%83%8f&id=047C00A7AC1FB84D922FD648A58C6C401BFB7EB1&FORM=IQFRBA',
      username: 'admin',
      password: '123456',
      email: '2946021889@qq.com',
      roleCode: 'admin',
      managerName: '\u5C0F\u660E',
      token: 'Admin Token'
    }
  ]
}
var login_default = [
  {
    url: '/mock/admin/Login/login',
    // 注意，这里只能是string格式
    method: 'post',
    response: ({ body }) => {
      const { username, password } = body
      const checkUser = createUserList().find(
        item => item.username === username && item.password === password
      )
      if (!checkUser) {
        return {
          code: 201,
          data: {
            message: '\u8D26\u53F7\u6216\u8005\u5BC6\u7801\u4E0D\u6B63\u786E'
          }
        }
      }
      const { token } = checkUser
      return { code: 200, data: { token } }
    }
  },
  //getUserInfo
  {
    url: '/mock/admin/User/info',
    // 注意，这里只能是string格式
    method: 'post',
    response: req => {
      const token = req.headers.Authorization
      const checkUser = createUserList().find(item => item.token === token)
      if (!checkUser) {
        return {
          code: 201,
          data: { message: '\u83B7\u53D6\u7528\u6237\u4FE1\u606F\u5931\u8D25' }
        }
      }
      return { code: 200, data: { checkUser } }
    }
  }
]
export { login_default as default }
//# sourceMappingURL=data:application/json;base64,ewogICJ2ZXJzaW9uIjogMywKICAic291cmNlcyI6IFsibW9jay9zb3VyY2UvbG9naW4udHMiXSwKICAic291cmNlc0NvbnRlbnQiOiBbImNvbnN0IF9faW5qZWN0ZWRfZmlsZW5hbWVfXyA9IFwiRDpcXFxccHJvamVjdFxcXFx0c3hcXFxcdHN4X3RlbV9hZG1pblxcXFxtb2NrXFxcXHNvdXJjZVxcXFxsb2dpbi50c1wiO2NvbnN0IF9faW5qZWN0ZWRfZGlybmFtZV9fID0gXCJEOlxcXFxwcm9qZWN0XFxcXHRzeFxcXFx0c3hfdGVtX2FkbWluXFxcXG1vY2tcXFxcc291cmNlXCI7Y29uc3QgX19pbmplY3RlZF9pbXBvcnRfbWV0YV91cm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